package com.implementsystem.prestacontas.funcao.client;

import java.io.IOException;
import java.net.URL;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import org.apache.commons.httpclient.HttpException;

import com.implementsystem.prestacontas.funcao.entity.RespostaFuncao;

public class FuncaoClient {
	
public RespostaFuncao listaFuncoes() throws HttpException, IOException, JAXBException{
		
		JAXBContext context = JAXBContext.newInstance(
        "com.implementsystem.prestacontas.funcao.client");
	    Unmarshaller unmarshaller = context.createUnmarshaller();
	    RespostaFuncao resposta = (RespostaFuncao)unmarshaller.unmarshal(new URL("http://api.tcm.ce.gov.br/sim/1_0/funcoes.xml"));
	    
		return resposta;
		
	}

}
